
import { Component, OnInit } from '@angular/core';
import { Router, NavigationEnd } from '@angular/router';
import { pathsItems, sideItems, Globals } from '../shared/global';

@Component({
  selector: 'app-work',
  templateUrl: './work.component.html',
  styleUrls: ['./work.component.scss'],
  providers: [Globals]
})
export class WorkComponent implements OnInit {

  sideItems;
  isCollapsed:boolean=false;
  
  constructor(private router: Router, public global: Globals) {
    this.sideItems = sideItems;
  }

  ngOnInit() {
    this.router.events
      .subscribe((event) => {
        //console.log(event)
        if (event instanceof NavigationEnd) {
          for (let item of pathsItems) {
            if (item.url === event.urlAfterRedirects) {
              this.global.paths = item
            }
          }
        }
      });
  }

}
